package com.zhl.algirithm1;

import java.util.Arrays;

public class Test2 {
    public static void main(String[] args) {
        //选择排序
        int[] arr = {5, 2, 4, 6, 1, 3};
        for(int i = 0; i< arr.length-1;i++){
            for (int j = i+1; j<arr.length;j++){
                if(arr[i]>arr[j]){
                    int temp = arr[i];
                    arr[i] = arr[j];
                    arr[j] = temp;
                }
            }
        }
        System.out.println("选择排序后："+ Arrays.toString(arr));
    }
}
